package com.yozinga;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.widget.Toast;

import com.yozinga.fragment.HomePageFragment;
import com.yozinga.fragment.HomePageFragment.HomeItemsListener;
import com.yozinga.util.AppData;

public class HomeActivity extends BaseActivity implements HomeItemsListener{


	@Override
	protected void onCreate(Bundle arg0) {
		super.onCreate(arg0);
		setContentView(R.layout.activity_homepage);
		AppData.TEMP_VALUE = "yozinga";
		//UnComment before generating binary
		//Crittercism.initialize(getApplicationContext(), "5203ba8fa7928a7d67000007");
		HomePageFragment merchantInfoFragment = new HomePageFragment();
		FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
		transaction.replace(R.id.flFragmentHolder, merchantInfoFragment);
		transaction.commit();
	}

	@Override
	public void onCategoryClicked(String categoryName,String id) {
		Toast.makeText(getApplicationContext(), categoryName, Toast.LENGTH_LONG).show();
		Intent restaurantIntent = new Intent(this,CategoryActivity.class);
		restaurantIntent.putExtra("categoryName", categoryName);
		restaurantIntent.putExtra("id",id);
		startActivity(restaurantIntent);
	}

}
